﻿
@{
    ViewData["Title"] = "角色权限分配|恩腾五金ERP";
    Layout = "~/Views/Shared/_layout2.cshtml";
}

@model ETWJ.DTO.RolePermissionEditModel

<div class="panel admin-panel">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>权限分配</strong></div>
    <div class="body-content">
        <form method="post" class="form-x" action="/RolePermission/RoleDistribution">

            <input type="hidden"  name="RoleId" value="@Model.Role.Id" />

            <div class="form-group">
                <div class="label">
                    <label>角色名称：</label>
                </div>
                <div class="field">
                    <input disabled type="text" class="input w50" value="@Model.Role.Name" name="title" data-validate="required:请输入标题" />
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>选择权限：</label>
                </div>
                <div class="field" style="padding-top:8px;">
                    @foreach ( var item in Model.Permissions )
                    {
                        var i = 0;
                        if (i % 2 == 0 && i != 0)
                        {
                            <br />
                            <br />
                        }
                        i++;
                        <label for="@item.Id"> <text>@item.Description</text><input checked="@Model.RolePermissions.Select(e=>e.PermissionId).Contains(item.Id)" name="PermissionId" value="@item.Id" id="@item.Id" type="checkbox" /></label> <text>&nbsp;&nbsp;&nbsp;&nbsp;</text>
                            
                    }

                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
                </div>
            </div>
        </form>
    </div>
</div>



